﻿@model Rated.Website.Models.ViewPageViewModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="item" class="clearfix">
    <div class="itementry clearfix">
        <div class="clearfix">
            <div class="description clearfix">
                <div class="contentSection clearfix">
                    <div class="titleBlock clearfix">
                        <div class="itemTitle">@Model.Item.Title</div>
                        <div class="breadcrumb">
                           @{Html.RenderPartial("BreadcrumbTrail", Model.BreadcrumbTrail);}
                        </div>
                    </div>
                    <div class="itemHeaderSummary">
                        #17 of 26 <h1 class="link inline">
                        <a href="#">@Model.Item.RatedItemType.RankText in South Wales</a></h1><br />
                        **** <span class="gotoReviews link"><span class="reviewCount">@Model.Item.Reviews.Count</span> Reviews</span>
                    </div>
                    @{
                        var mainImage = Model.Item.Images.Where(o => o.IsDefault == true).SingleOrDefault();
                        if (mainImage != null)
                        {
                            var mainImageUrl = string.Format("{0}.{1}", mainImage.Filename, mainImage.Extension);
                        <div class="images clearfix">
                            <div class="mainImageContainer">
                                <img src="~/Images/@mainImageUrl" class="mainImage" title="@mainImage.Title" />
                            </div>
                        </div>
                        }
                    }
                    <div class="allImages">
                    </div>
                    <div class="allVideos">
                    </div>
                    @{
                        var sections = Model.Item.RatedItem_Attribute.Select(o => o.Attribute.AttributeType).Distinct().ToList();
                        if (sections.Count > 0)
                        {
                            <div class="attributeSection">
                            @{ foreach (var s in sections)
                               {
                                <div class="attributeSectionEntry">
                                <h3>@s.Title</h3>
                                <ul>
                                    @{
                                       var atts = Model.Item.RatedItem_Attribute.Where(o=>o.Attribute.AttributeType==s).ToList();
                                       foreach (var entry in atts)
                                       { 
                                        <li><span class="attributeTag">@entry.Attribute.Text</span> </li>
                                       }
                                     }
                                </ul>
                                </div>
                               }
                            }
                         </div>
                        }
                    }
                    <div class="likeMe link">Like</div>
                </div>
                <div class="contentSection">
                    <h2>
                        Profile</h2>
                    @Model.Item.Description
                </div>
            </div>
        </div>
    </div>
    <div class="contentSection contentSection_bottom">
        @{Html.RenderPartial("Reviews", Model);}
    </div>
</div>
